/**
 * 文件名：CategoryService
 * 版权：Copyright by www.fsmeeting.com
 * 描述：
 * 修改人：kezs
 * 修改时间：2017/10/11
 * 修改内容：
 */
package com.huluhome.service.impl;

import com.huluhome.dao.ICategoryDao;
import com.huluhome.domain.Category;
import com.huluhome.service.ICategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * 〈一句话功能简述〉
 *
 * @author kezs
 * @version 2017/10/11
 * @see CategoryService
 */
@Service("categoryService")
public class CategoryService implements ICategoryService {

    @Resource
    private ICategoryDao categoryDao;

    @Override
    public List<Category> getCategories(int status) {
        return categoryDao.getCateGories(status);
    }

    @Override
    public int addCategory(String categoryName, int status) {
        Category category = new Category();
        category.setCategoryName(categoryName);
        category.setStatus(status);
        category.setCreateTime(new Date());
        return categoryDao.addCategory(category);
    }
}
